#ifndef __DRV_HAL_LED_H_
#define __DRV_HAL_LED_H_
#include "board.h"

#define _HAL_LED0_PIN              CONS2(GPIO_PIN_,BOARD_CONFIG_HAL_LED0_NUM)
#define _HAL_LED1_PIN              CONS2(GPIO_PIN_,BOARD_CONFIG_HAL_LED1_NUM)
#define _HAL_LED2_PIN              CONS2(GPIO_PIN_,BOARD_CONFIG_HAL_LED2_NUM)
#define _HAL_LED3_PIN              CONS2(GPIO_PIN_,BOARD_CONFIG_HAL_LED3_NUM)

#define _HAL_LED0_PORT             CONS2(GPIO,BOARD_CONFIG_HAL_LED0_PORT)
#define _HAL_LED1_PORT             CONS2(GPIO,BOARD_CONFIG_HAL_LED1_PORT)
#define _HAL_LED2_PORT             CONS2(GPIO,BOARD_CONFIG_HAL_LED2_PORT)
#define _HAL_LED3_PORT             CONS2(GPIO,BOARD_CONFIG_HAL_LED3_PORT)

#define _HAL_LED0_RCC              CONS3(__HAL_RCC_GPIO,BOARD_CONFIG_HAL_LED0_PORT,_CLK_ENABLE)
#define _HAL_LED1_RCC              CONS3(__HAL_RCC_GPIO,BOARD_CONFIG_HAL_LED1_PORT,_CLK_ENABLE)
#define _HAL_LED2_RCC              CONS3(__HAL_RCC_GPIO,BOARD_CONFIG_HAL_LED2_PORT,_CLK_ENABLE)
#define _HAL_LED3_RCC              CONS3(__HAL_RCC_GPIO,BOARD_CONFIG_HAL_LED3_PORT,_CLK_ENABLE)

#define _HAL_LED0_NUM              0x01
#define _HAL_LED1_NUM              0x02
#define _HAL_LED2_NUM              0x04
#define _HAL_LED3_NUM              0x08

void led_pin_init(void);
void led_ctrl(unsigned char cmd);
void led_write(unsigned char index ,unsigned char value);

#endif // __DRV_HAL_LED_H_
